POV-Ray : Newsgroups : povray.newusers : Is it possible to have color_map values depend on distance from a point ? : Is it possible to have color_map values depend on distance from a point ? Server Time
2 Nov 2024 17:17:15 EDT (-0400)
  Is it possible to have color_map values depend on distance from a point ?  
From: Bernard Hatt
Date: 18 Nov 2003 17:35:01
Message: <web.3fba9d39f0c1c7f425bdb9a40@news.povray.org>
I'm trying to put a coloured bozo 'splodge' on an object, where the
color_map threshold varies from the center to the edge.

At the center of the splodge it should be:
     bozo color_map [0.0 rgbf 1] [0.0 Red ]   ie. all Red
Halfway towards the edge it should be
     bozo color_map [0.5 rgbf 1] [0.5 Red ]   ie. half and half
and at the edge
     bozo color_map [1.0 rgbf 1] [1.0 Red ]   ie. all background

The best approximation I have to this is:

box { <-2,-2,0> <2,2,1 >
    texture { pigment {Green}}
#declare i=0;
#while (i<1.0)
    texture {
        pigment {
            object {
            sphere { 0 i }
                pigment { rgbf 1 }
                pigment {
                    bozo scale .025
                    color_map {
                        [i rgbf 1]  [i Red]
                    }
                }
            }
        }
    }
#declare i=i+0.02;
#end
}

Which looks OK at at distance, but you can see the bands for the layers
if you are close. Is there a better way to create this effect ?

Thanks,

Bernard


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.